<template>
<div class="all">
  <div class="top">
    <Header
      title="我的授权"
      @click-left="back">
    </Header>
    <div class='tabBar'>
      <router-link :to="{path:'/MyEmpowerDoctor/DoctorEmpowerList',query:
      {userid: this.userid, team_id: this.team_id, oauth_data_user_id: this.userid}}" replace class='tab' :class="{'act':select===1}" @click.native='select=1'>
        档案授权
        <p class='line'></p>
      </router-link>
      <router-link :to="{path: '/MyEmpowerDoctor/YewuEmpowerList', query:
       {userid: this.userid, team_id: this.team_id, patient_user_id: this.userid}}" replace class='tab' :class="{'act':select===2}" @click.native='select=2'>
        业务授权
        <p class='line'></p>
      </router-link>
    </div>
  </div>
  <router-view></router-view>
</div>
</template>

<script>
import Header from '../../../components/Vue/Header'
export default {
  name: 'MyEmpowerDoctor',
  components: {
    Header
  },
  computed: {
  },
  data () {
    return {
      select: 1,
      oauth_data_user_id: this.$route.query.oauth_data_user_id,
      userid: this.$route.query.userid,
      team_id: this.$route.query.team_id
    }
  },
  mounted () {
    if (this.$route.name == 'YewuEmpowerList') {
      this.select = 2
    }
  },
  methods: {
    // 返回
    back () {
      this.$router.history.go(-1)
    }
  }
}
</script>

<style scoped lang="scss">
.all{
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #FAF9FE;
}
.top{
  position: sticky;
  top: 0;
}
.tabBar{
  width: 100%;
  height: 44px;
  overflow: hidden;
  background-color: white;

  .tab{
    width: 50%;
    float: left;
    font-size: 15px;
    color: #333333;
    line-height: 44px;
    text-align: center;
    position: relative;
    .line{
      display: none;
      width: 25px;
      height: 2px;
      border-radius: 1px;
      background-color: #1DA4F2;
      position: absolute;
      left: 50%;
      bottom: 5px;
      transform: translateX(-50%);
    }

    &.act{
      color: #1DA4F2;
      .line{
        display: block;
      }
    }

  }
}
</style>
